package com.cgy.controller;
 
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.cgy.entity.Student;
import com.cgy.entity.Teacher;
import com.cgy.service.StudentService;
import com.cgy.service.TeacherService;

@CrossOrigin
@RestController
@RequestMapping("/front")
public class shuakaYZ {

	private static final String card = null;
	@Autowired
	private StudentService  studentService;
	@Autowired
	private TeacherService teacherService;
	
	@RequestMapping("/login")
	public String  frontlogin(Integer lCardId) {
		List<Teacher>  tlist=teacherService.findLikecard(lCardId);
		List<Student>  slist=studentService.findLikecard(lCardId);
		System.out.println("tlist.size()>>>"+tlist.size());
		System.out.println("slist.size()>>>>"+slist.size());
		if(tlist.size()!=0||slist.size()!=0) {
			System.out.println(123);
			return   "existence";
			 
		}else {  
			System.out.println(456);
			return "notexistence";	
		}
		
		
		
		
		
	}
}
